/**
 * 删除cookie
 * @param name
 */
function delMyCookie(name) {
	var expdate = new Date();
	expdate.setTime(expdate.getTime() - (2 * 60 * 60 * 1000));
	setMyCookie(name, "", expdate);
}

/**
 * 添加cookie
 * @param name
 * @param value
 * @param expires
 */
function setMyCookie(name, value, expires) {
	var today = new Date();
	var expiry = new Date(today.getTime() + 2 * 60 * 60 * 1000);
	if (expires == "" || expires == null) {
		expires = expiry;
	}
	var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "");
	document.cookie = curCookie+";path=/";
}

/**
 * 获取cookie值
 * @param sName
 * @returns
 */
function getMyCookie(sName) {
	var aCookie = document.cookie.split("; ");
	for (var i = 0; i < aCookie.length; i++) {
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0]) {
			return aCrumb[1];
		}
	}
	return "";
}